<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <button>点击</button>
    <div></div>

</body>

<script>
    // location.href= '地址/路径' 跳转页面

    var btn = document.querySelector('button');
    var div = document.querySelector('div');

    btn.onclick = function() {
        var time = 5;
        setInterval(function() {
            div.innerHTML = '还有' + time + '秒跳转到首页';
            time--;
            if (time == 0) {
                // 跳转页面
                location.href = './08-发送短信案例.html'
            }
        }, 1000)
    }
</script>